@prefix rdf:	<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> . 
@prefix sh:	<http://www.w3.org/ns/shacl#>. 
@prefix xsd:	<http://www.w3.org/2001/XMLSchema#>.
@prefix ex:	<http://example.org/>.

ex:PersonShape
	a sh:NodeShape ;
	sh:targetClass ex:Person ;    # Applies to all persons
	sh:property [
		sh:path ex:ssn ;           # constrains the values of ex:ssn
		sh:maxCount 1 ;
		sh:datatype xsd:string ;
		sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ;
	] ;
	sh:property [
		sh:path ex:worksFor ;
		sh:class ex:Company ;
		sh:nodeKind sh:IRI 
	] .

ex:OrganizationShape
	a sh:NodeShape ;
	sh:targetClass ex:Organization ;    # Applies to all organizations
	sh:property [
		sh:path ex:employee ;           # constrains the values of ex:ssn
		sh:node ex:PersonShape
	] .